//
//  HLELowcostBleManager.h
//  HLELowcostPeripherial
//
//  Created by hle1 on 2021/8/19.
//

#import <Foundation/Foundation.h>
#import "HLELowcostBleInforModel.h"
#import <ReactiveObjC/ReactiveObjC.h>
NS_ASSUME_NONNULL_BEGIN

@interface HLELowcostBleManager : NSObject
/// 已经建立一对一连接的设备
@property(nonatomic, strong) NSMutableArray <HLELowcostBleInforModel *>*connectedPeripherals;
/// 发现过的外设
@property(nonatomic, strong) NSMutableArray <HLELowcostBleInforModel *>*discoverPeripherals;
/// 心跳的信号
@property(nonatomic, strong) RACSubject *heartbeatSubject;
/// 单例
+ (instancetype)sharedInstance;

/// 发送数据
/// @param serialNum 序列号
/// @param data 数据
/// @param complete 回调
- (void)sendMsgBySerialNum:(NSString *)serialNum data:(NSData *)data complete:(nullable void (^)(BOOL isSuccess,id data))complete;


/// 断开设备
/// @param serialNum 序列号
- (void)disconnectBySerialNum:(NSString *)serialNum;

/// 断开所有连接的设备
- (void)cancelAllPeripheralsConnection;
@end

NS_ASSUME_NONNULL_END
